package com.yueqian.teachercode;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * @author Administrator
 */
public class Account implements Serializable {
    private String name;
    private double money;
    private Date dob;
    private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public Account(String name, double money, int year, int month, int day) {
        super();
        this.name = name;
        this.money = money;
        dob = new GregorianCalendar(year, month - 1, day).getTime();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public Date getDob() {
        return dob;
    }

    public void setDob(Date dob) {
        this.dob = dob;
    }

    @Override
    public String toString() {
        return "Account [name=" + name + ", money=" + money + ", dob=" + SDF.format(dob) + "]";
    }


}
